{include file="public_head" /}

<link href="__STATIC__/css/select/select2.min.css" rel="stylesheet">
<body class="nav-md">

<div class="container body">

    <div class="main_container">

        {include file="public_sidebar,public_nav" /}
        <!-- page content -->
        <div class="right_col" role="main">
            <div class="">

                <div class="page-title">
                    <div class="title_left">
                        <h3>红包管理</h3>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="row">
                    <div class="col-md-12 col-sm-12 col-xs-12">
                        <div class="x_panel">
                            <div class="x_title">
                                <h2>{$mate_title}</h2>
                                <ul class="nav navbar-right panel_toolbox">
                                    <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                                    </li>
                                    <li><a class="close-link"><i class="fa fa-close"></i></a>
                                    </li>
                                </ul>
                                <div class="clearfix"></div>
                            </div>
                            <div class="x_content">
                                <br/>
                                <form class="form-horizontal form-label-left" enctype="multipart/form-data" action=""
                                      method="post" id="registerForm">

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">接收人：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <select name="member_id" class="select2_single"
                                                    style="width: 500px;"
                                                    datatype="*"
                                                    nullmsg="请选择接收人！" errormsg="请选择接收人！">
                                                <option value=" ">请选择接收人</option>
                                                {volist name="data" id="list"}
                                                <option value="{$list.id}"
                                                        {eq name='list.id' value='$item.member_id|default=""' }
                                                        selected
                                                        {/eq}>
                                                {$list.username} / {$list.MemberInfo.name}
                                                </option>
                                                {/volist}
                                            </select>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>


                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">红包标题：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入红包标题"
                                                   class="form-control col-md-7 col-xs-12" name="title"
                                                   value="{$item.title|default=''}"
                                                   datatype="*"
                                                   nullmsg="请输入红包标题！" errormsg="请输入红包标题！"
                                            >
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">红包描述：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <textarea type="text" placeholder="请填写红包描述"
                                                      datatype="*"
                                                      nullmsg="请填写红包描述！" errormsg="请填写红包描述！"
                                                      class="form-control col-md-7 col-xs-12" name="content" style="max-width:100%;">{$item.content|default=''}</textarea>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>


                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">红包金额：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入使用价格"
                                                   class="form-control col-md-7 col-xs-12" name="actual_price"
                                                   value="{$item.actual_price|default=''}"
                                                   datatype="double"
                                                   nullmsg="请输入红包金额！" errormsg="请输入红包金额！"
                                            >
                                        </div>
                                        <label class="control-label col-md-1 col-sm-1 col-xs-1">消费满：</label>
                                        <div class="col-md-2 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请输入满减价格"
                                                   class="form-control col-md-7 col-xs-12" name="virtual_price"
                                                   value="{$item.virtual_price|default=''}"
                                                   datatype="double"
                                                   nullmsg="请输入满减金额！" errormsg="请输入满减金额！"
                                            >
                                        </div>
                                        <label class="control-label col-md-0.5 col-sm-0.5 col-xs-0.5">可用</label>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">充值金额(最低)：</label>-->
                                        <!--<div class="col-md-2 col-sm-6 col-xs-12">-->
                                            <!--<input type="text" placeholder="请输入充值金额"-->
                                                   <!--class="form-control col-md-7 col-xs-12" name="market_price_a"-->
                                                   <!--value="{$item.market_price_a|default=''}"-->
                                                   <!--datatype="double"-->
                                                   <!--nullmsg="请输入充值金额！" errormsg="请输入充值金额！"-->
                                            <!--&gt;-->
                                        <!--</div>-->
                                        <!--<label class="control-label col-md-1 col-sm-1 col-xs-1">充值金额（最高）：</label>-->
                                        <!--<div class="col-md-2 col-sm-6 col-xs-12">-->
                                            <!--<input type="text" placeholder="请输入充值金额"-->
                                                   <!--class="form-control col-md-7 col-xs-12" name="market_price_b"-->
                                                   <!--value="{$item.market_price_b|default=''}"-->
                                                   <!--datatype="double"-->
                                                   <!--nullmsg="请输入充值金额！" errormsg="请输入充值金额！"-->
                                            <!--&gt;-->
                                        <!--</div>-->
                                    <!--</div>-->

                                    <!--<div class="form-group">-->
                                        <!--<label class="control-label col-md-3 col-sm-3 col-xs-12">派发数量：</label>-->
                                        <!--<div class="col-md-2 col-sm-6 col-xs-12">-->
                                            <!--<input type="text" placeholder="请填写派发数量"-->
                                                   <!--class="form-control col-md-7 col-xs-12" name="number"-->
                                                   <!--value="{$item.number|default='0'}"-->
                                                   <!--datatype="int"-->
                                                   <!--nullmsg="请填写派发数量！" errormsg="请填写派发数量！"-->
                                            <!--&gt;-->
                                        <!--</div>-->
                                    <!--</div>-->

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">上架状态：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_1" class="cartradio"
                                                       value="1"
                                                       datatype="*"
                                                       nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                                       {eq name='item.status|default=""' value='1' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_1"></label>
                                                <span>上架</span>
                                                &nbsp;&nbsp;
                                            </label>
                                            <label class="radio_box">
                                                <input type="radio" name="status" id="status_2" class="cartradio"
                                                       value="2"
                                                       datatype="*"
                                                       nullmsg="请选择启用状态！" errormsg="请选择启用状态！"
                                                       {eq name='item.status|default=""' value='2' }
                                                       checked
                                                       {/eq}
                                                >&nbsp;&nbsp;
                                                <label for="status_2"></label>
                                                <span>下架</span>
                                                &nbsp;&nbsp;
                                            </label>
                                        </div>
                                    </div>

                                    <div class="divider-dashed"></div>

                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">使用区间时间：</label>
                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <input type="text" placeholder="请选择时间区间"
                                                   class="form-control col-md-7 col-xs-12" name="interval_timer"
                                                   id="interval_timer"
                                                   {present name="$item.id"}
                                                   value="{$item.start_time|date='Y-m-d',###} / {$item.end_time|date='Y-m-d',###}"
                                                   {/present}
                                                   datatype="*"
                                                   nullmsg="请选择时间区间！" errormsg="请选择时间区间！"
                                            >
                                        </div>
                                    </div>

                                    <div class="ln_solid"></div>

                                    <div class="form-group">
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                                            {present name="$item.id"}
                                            <input type="hidden" name="id" value="{$item.id}">
                                            {/present}
                                            <!--<input type="hidden" name="member_id" value="0"/>-->
                                            <button type="submit" class="btn btn-primary">提交</button>
                                            <a type="reset" class="btn btn-success" onclick="history.go(-1)">返回</a>
                                        </div>
                                    </div>

                                </form>
                            </div>
                        </div>
                    </div>
                </div>


            </div>
            <!-- /page content -->

        </div>

    </div>
</div>

{include file="public_foot" /}
<!-- validform -->
<!--<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>-->
<!--<script src="__STATIC__/js/layer.js"></script>-->
<!--<script src="__STATIC__/js/select/select2.full.min.js"></script>-->
<!-- daterangepicker -->
<script src="__STATIC__/js/datepicker/daterangepicker.js"></script>



<!-- Times -->
<script src='__STATIC__/js/datepicker/WdatePicker.js'></script>
<!-- validform -->
<script src="__STATIC__/js/Validform_v5.3.2_min.js"></script>
<script src="__STATIC__/js/layer.js"></script>
<!-- select -->
<script src="__STATIC__/js/select/select2.full.min.js"></script>
<!-- upload -->
<script type="text/javascript" src="__STATIC__/js/uploadPreview.js"></script>
<!-- linkage -->
<script type="text/javascript" src="__STATIC__/js/jquery.livequery.js"></script>
<!-- ueditor -->
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/ueditor.all.min.js"></script>
<script type="text/javascript" charset="utf-8" src="__STATIC__/editor/lang/zh-cn/zh-cn.js"></script>
<script>

    // validform
    $(function () {

        $.Tipmsg.r = null;
        $.Datatype.double = /^[0-9]+\.?[0-9]*$/;   //正整数和小数
        $.Datatype.int = /^[1-9]\d*$/;  //非0正整数
        var showmsg = function (msg) {
            //假定你的店铺商品提示方法为showmsg， 在方法里可以接收参数msg，当然也可以接收到o及cssctl;
            alert(msg);
        };
        $("#registerForm").Validform({
            tiptype: function (msg) {
                layer.msg(msg);
            },
            tipSweep: true
        });


        // interval_timer
        $('#interval_timer').daterangepicker(null,
                function(start, end, label) {
                    console.log(start.toISOString(), end.toISOString(), label);
                });

        // select2
        $(".select2_single").select2({
            placeholder: "请选择接收人",
            allowClear: true
        });
    })
</script>

</body>

</html>
